PGP Corporation Tech Note

Windows 2000 Active Directory:
Setting Up and Troubleshooting Storage of PGP preferences

Copyright © 2003 by PGP Corporation. All Rights Reserved.


This Tech Note describes how to set up and troubleshoot the storage and retrieval of PGP preferences in and off of Windows 2000 Active Directory.

  1. Copy the remoteprefs.ldf to a directory where you can access it from the machine on which you plan to do the import.
  2. This file is in LDIF (RFC 2849) format. LDIF stands for LDAP (RFC 2251) Data Interchange Format and is an Internet Standard for a common file format for operating on LDAP compliant directory services from different vendors. You might choose to work on the DC (domain controller) itself or choose to login on another machine as a user that has schema change rights. You should have the Windows 2000 support tool ldifde.exe in your path. ldifde stands for LDIF Directory Exchange. This is the only tool you need to affect the schema changes. The support tools installer automatically adds the target directory to your path.

  3. Open the remoteprefs.ldf file in an editor that has search and replace capabilities. Search and replace DC=yoursubdomain,DC=yourdomain with your domain hierarchy. (Notepad, for example, would do the job on an interactive logon session.). One of the places that will give your domain hierarchy is the node directly under Schema node in a snapin called "ADSI Edit". Save and close the remoteprefs.ldf file.
  4. Before the ldf file can be imported, the DC should be the Schema Master and schema updates should be allowed on the DC. Schema Master is a FSMO (Flexible Single Master Operations) role that makes the DC responsible for performing updates to the directory schema. The first DC installed in an enterprise is the Schema Master by default. In general, the fsmoRoleOwner property of the schema container on any DC has the DN of the nTDSDSA object whose parent is the Schema Master server.

    For more information on how to view and transfer the FSMO role of Schema Master, refer to Microsoft Knowledge Base articles Q255690 and Q255504.

    To turn on schema updates on the DC, run the MMC snapin called "Active Directory Schema". Right click on the root node of that snapin and choose operations master. A dialog pops up; make sure the check box that says "The schema may be modified on this Domain Controller" is checked. You may also have the same effect by setting REG_DWORD value "Schema Update Allowed" to 1 (or greater) under the following registry key:

    HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\NTDS\Parameters

    For more on how to enable schema updates, refer to Microsoft Knowledge Base articles Q279978 and Q285172.

  5. In the simplest of cases you need to type on the command prompt "ldifde -i -f remoteprefs.ldf -v".
  6. -i stands for import and -f supplies the file name to import from. -v turns on verbose mode.

    For more on command line options, type ldifde /? You may look at Microsoft Knowledge Base article Q237677 for more information on import and export using ldifde. Other options might be necessary (for example, if you have changed the server port from 389 to something else or if you want the log files to be located at a different directory than the current directory, etc.).

  7. You should see the imports happening on screen for the entries. ldifde should create ldif.err and ldif.log files in the directory, providing more information about the import. If there is an error reported, the ldif.log file is very useful in identifying and locating the error and the line number. In case of an error, go to the erring line number and take a close look to see if anything looks suspicious. If nothing looks wrong, remove all successful entries before the erring line and save the file. Rerun ldifde with identical parameters and look for errors. Sometimes the "No such attribute" error can happen even though the attribute has been defined and imported. In any case, the deletions make the file smaller and easier to inspect while avoiding "already existing" errors when you try to import a second time.

    After a successful import, you should see the new attributes and classes in the lists shown by the "Active Directory Schema" MMC snapin. Their names always start with pgp.

  8. Now get into ADSI Edit MMC snapin and connect to the domain naming context ("Domain NC"). Go to the entry that corresponds to the path that you used to replace the domain paths in the ldf file. This will be the topmost node under the "Domain NC" node shown by ADSI Edit and would look like "DC=example,DC=com". Click on that node. You should see various objects under this such as Builtin and Computers etc. We will refer to this as the topmost node.

    Now you need to create a container where PGP preferences will be stored. Traverse the tree to a node where you would like to keep the prefs container. Right click on the list on the right hand side and choose New Object from the context menu. Choose class as container. Name it as appropriate. Keep the DN of this container handy; you will be needing it soon.

  9. After creating the new object, you need to make sure the permissions are good enough to be accessed by the account that will be used while connecting via PGPadmin . PGP currently talks LDAPv2 with simple authentication when updating the preferences onto the server. Retrieving configuration from server is anonymous (no username). Note that unless you use LDAPS the account and password will travel clear on the network when you are trying to update the server and PGPadmin asks for userid and password. Therefore it is good to use an ordinary user account when LDAPS is not in use and give that account sufficient write/modify access to the new container. Then change the password and rename and disable the account immediately after the preferences are updated or retrieved. (Re-enable the account when you need it again.)

    If you created an account just now and plan to use the account for updating preferences on the server you would need to give the account access to the newly created node. Right click on the node and click on the Security tab. Click the Advanced button and add the account (you plan to logon as from PGPadmin) to the access list. In the permission entry property sheet choose applies onto "This object and all child objects" and grant "List contents" and "Read All Properties" and "Write All Properties" permissions. Check the box titled "Apply these permissions to objects and/or containers within this container only". Make sure that no other permission is accidentally turned on. Press OK. Follow the same procedure in the advanced access control settings dialog and add Everyone with "Read All Properties" access to the node. Note that Everyone should not be given write/modify access to this node, just read access is what is needed. Check individual permissions on the new object and make sure that Everyone  has “Read All Properties” permissions and nothing more.

    If you chose to store preferences in a container that has other containers as children instead of creating a new container as was advised in this document, you might want to check permissions on other immediate containers to make sure that the new account or Everyone does not have more access than needed. Since this permission only affects just the immediate containers, check to make sure that no access is being propagated to other containers within those containers.

  10. Start PGPadmin and click Administrative Options button. Then configure PGP preferences as necessary. Finally click on the updates tab. Select Automatically update administrative options every <> days option. Then in the LDAP Server URL edit box - type the LDAP URL of the PGP preferences container that you created in step 6. You may copy the URL directly from the Path value in Attributes page when you right click and choose Properties on the new container in ADSI Edit snapin. Make sure DNS is set up to resolve the LDAP host from the host on which PGPadmin in running. Otherwise replace the hostname in the URL with IP address of your DC. Press "OK" and you will be back at the PGPadmin main screen.

    Now click "Update Server Configuration" and give the FQDN (fully qualified distinguished name) and password of the newly created account (or your administrative account as the case may be) in the authentication prompt. The FQDN of the Administrator account for a domain in a default Windows 2000 installation is of the form CN=Administrator,CN=Users,DC=subdomain,DC=domain etc. If the permissions are correct, you will be able to upload server configuration from PGPadmin. If an insufficient rights error is reported while uploading preferences to the server, verify the access rights again and make sure the access is exactly as you intended. Also, make sure the access is not any more than desired.

    Try retrieving preferences by clicking the "Retrieve Server Configuration" button in PGPadmin main screen. If an error prompt appears reporting partial results were returned, check permissions for Everyone and try again. Your Active Directory can now store and retrieve PGP preferences.